package com.shangjinrong.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author Naruto
 */

@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum LendStatusEnum {
    CHECK(0, "待发布"),
    INVEST_RUN(1, "募资中"),
    PAY_RUN(2, "还款中"),
    PAY_OK(3, "已结清"),
    FINISH(4, "结标"),
    CANCEL(-1, "撤标");

    private Integer code;
    private String status;

    public static String getMsgByStatus(int status) {
        LendStatusEnum[] values = LendStatusEnum.values();

        for (LendStatusEnum statusEnum : values) {
            if (statusEnum.code == status) {
                return statusEnum.getStatus();
            }
        }
        return "";
    }
}
